<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3_数据类型</title>
</head>
<body>


<script>
/*js数据类型：原始类型  引用类型*/

/*1.原始类型：number string boolean null undefined*/
var a =1;
var b = 1.12;
/*typeof 变量名：推断变量的类型*/
console.log(a,typeof a,b,typeof b);
var c = '你好';
var d = '你好呀';
console.log(c,typeof c,d,typeof d);
var e =true;
var f = false;
console.log(e,typeof e,f,typeof f);
var g;
console.log(g,typeof g)

/*2.对象*/
var obj = {
    name:'张三',
    age:18
};
console.log(obj,typeof obj);
console.log(obj.name);
console.log(obj.age);
/*可修改属性*/
obj.age=19;
console.log(obj.age);
/*可添加属性*/
obj.like = '国庆';
console.log(obj.like);
console.log(obj.play);

/*JS数组*/
var arr = ['张三',18,9.9,false];
console.log(arr[0]);
console.log(arr[3]);
console.log(arr[99]);
arr[99] = '管理员';
console.log(arr[99]);
</script>
</body>
</html>